package com.senter.data.dbflow;

import android.app.Application;

import com.raizlabs.android.dbflow.config.DatabaseConfig;
import com.raizlabs.android.dbflow.config.DatabaseDefinition;
import com.raizlabs.android.dbflow.config.FlowConfig;
import com.raizlabs.android.dbflow.config.FlowManager;
import com.raizlabs.android.dbflow.sqlcipher.SQLCipherOpenHelper;
import com.raizlabs.android.dbflow.structure.database.DatabaseHelperListener;
import com.raizlabs.android.dbflow.structure.database.OpenHelper;
import com.senter.data.dbflow.db.DemoDataBase;

public class MainApplication extends Application {

    @Override
    public void onCreate() {
        super.onCreate();
        FlowManager.init(this);


        // 数据保存到默认路径并加密,加密的密码是senter 开发阶段先不用加密
//        FlowManager.init(FlowConfig.builder(this).addDatabaseConfig(DatabaseConfig.builder(DemoDataBase.class).openHelper(new DatabaseConfig.OpenHelperCreator() {
//            @Override
//            public OpenHelper createHelper(DatabaseDefinition databaseDefinition, DatabaseHelperListener helperListener) {
//                return new SQLCipherOpenHelper(databaseDefinition, helperListener) {
//                    @Override
//                    protected String getCipherSecret() {
//                        return "senter";
//                    }
//                };
//            }
//        }).build()).build());
    }


}
